*****Set the working directory to where the datasets are located, e.g. cd "/home/.../"

use "study_sample.dta"

log using "logfile", text

*****Generating conspiracy beliefs and political knowledge scales

msp item_cancer item_crisis item_chemtrails
alpha item_cancer item_crisis item_chemtrails, generate(conspiracy)

msp know*
alpha know1 know2 know3 know5, generate(knowledge)


*****Logistic regression on survey completion

logit completed age female education interest mobile

outreg2 using myfile, alpha(0.001, 0.01, 0.05) tex replace


*****Study sample referrals

tab refer if completed==1, missing 
tab refer if completed==0, missing 


*****Study size

drop if completed==0
drop if region==1

count if age==.|female==.|region==.|domicile==.|education==.


*****Recoding auxiliary variables for reweighting

gen age_groups=age

recode age_groups (min/24=1) (25/39=2) (40/54=3) (55/64=4) (65/max=5) 

gen education_groups=education

recode education_groups (2=1) (3=2) (4=3) (5=4)

gen urban=.
recode urban .=1 if domicile==1|domicile==2|domicile==3
recode urban .=0 if domicile==4|domicile==5

gen nuts=.
recode nuts .=1 if region==3
recode nuts .=2 if region==2|region==6|region==7|region==10
recode nuts .=3 if region==5|region==8|region==9|region==13|region==14
recode nuts .=4 if region==4|region==11|region==12


*****Sample descriptive statistics (study sample)

tab age_groups
tab female
tab education_groups
tab urban
tab nuts


*****Merging in the reference sample (Dianeosis data)

append using "reference_sample.dta"

gen dianeosis=1 
recode dianeosis 1=0 if id!=.

recode x1 .=1


*****Sample descriptive statistics (reference sample)

tab age_groups if dianeosis==1
tab female if dianeosis==1
tab education_groups if dianeosis==1
tab urban if dianeosis==1
tab nuts if dianeosis==1


*****Generating the entropy balance weights

ebalance dianeosis i.age_groups female i.education_groups urban i.nuts, wttreat basewt(x1)


*****Table 1 Polychoric correlations

polychoric item_* [pweight=_webal], pw  dots
pwcorr item_* if _webal!=., obs


*****Figure 1 OLS regressions

label variable age "Age"
label variable female "Female"
label variable knowledge "Political knowledge"
label variable interest "Political interest"
label variable conspiracy "Conspiracy beliefs"
label variable leftright "Left-right self-placement"
label variable income "Subjective income"
label variable health_self "Vulnerable health (self)"
label variable health_family "Vulnerable health (family)"
label variable work_self "Affected employment (self)"
label variable work_family "Affected employment (family)"
label variable education "Education"


svyset [pweight= _webal]

svy: reg item_weapon age female education income interest knowledge leftright conspiracy health_self health_family work_self work_family

outreg2 using myfile, alpha(0.001, 0.01, 0.05) tex replace

coefplot, drop(_cons) xline(0, lcolor(gs12)) msymbol(plus) mlabels(age = 11 "p>.1") xlabel(-.5(.1).8) xtitle(Unstandardized coefficients with 95% confidence intervals) title(COVID-19 conspiracy theory)

graph save Graph "Figure1a.gph", replace

svy: reg item_liberties age female education income interest knowledge leftright conspiracy health_self health_family work_self work_family

outreg2 using myfile, alpha(0.001, 0.01, 0.05) tex 

coefplot, drop(_cons) xline(0, lcolor(gs12)) msymbol(plus) mlabels(age = 11 "p>.1") xlabel(-.5(.1).8) xtitle(Unstandardized coefficients with 95% confidence intervals) title(COVID-19 scepticism (civil liberties))

graph save Graph "Figure1b.gph"

svy: reg item_flu age female education income interest knowledge leftright conspiracy health_self health_family work_self work_family

outreg2 using myfile, alpha(0.001, 0.01, 0.05) tex 

coefplot, drop(_cons) xline(0, lcolor(gs12)) msymbol(plus) mlabels(age = 11 "p=.06") xlabel(-.5(.1).8) xtitle(Unstandardized coefficients with 95% confidence intervals) title(COVID-19 scepticism (common flu))

graph save Graph "Figure1c.gph"

svy: reg item_herd age female education income interest knowledge leftright conspiracy health_self health_family work_self work_family

outreg2 using myfile, alpha(0.001, 0.01, 0.05) tex 

coefplot, drop(_cons) xline(0, lcolor(gs12)) msymbol(plus) mlabels(age = 11 "p<.001" leftright = 11 "p>.1" health_self = 11 "p=.06" health_family = 11 "p=.04") xlabel(-.5(.1).8) xtitle(Unstandardized coefficients with 95% confidence intervals) title(COVID-19 scepticism (herd immunity))

graph save Graph "Figure1d.gph"


*****OLS regressions with fully factorized education

svy: reg item_weapon age female i.education income interest knowledge leftright conspiracy health_self health_family work_self work_family

outreg2 using myfile, alpha(0.001, 0.01, 0.05) tex replace

svy: reg item_liberties age female i.education income interest knowledge leftright conspiracy health_self health_family work_self work_family

outreg2 using myfile, alpha(0.001, 0.01, 0.05) tex

svy: reg item_flu age female i.education income interest knowledge leftright conspiracy health_self health_family work_self work_family

outreg2 using myfile, alpha(0.001, 0.01, 0.05) tex

svy: reg item_herd age female i.education income interest knowledge leftright conspiracy health_self health_family work_self work_family

outreg2 using myfile, alpha(0.001, 0.01, 0.05) tex


*****OLS regressions with fully factorized subjective income

svy: reg item_weapon age female education i.income interest knowledge leftright conspiracy health_self health_family work_self work_family

outreg2 using myfile, alpha(0.001, 0.01, 0.05) tex replace

svy: reg item_liberties age female education i.income interest knowledge leftright conspiracy health_self health_family work_self work_family

outreg2 using myfile, alpha(0.001, 0.01, 0.05) tex

svy: reg item_flu age female education i.income interest knowledge leftright conspiracy health_self health_family work_self work_family

outreg2 using myfile, alpha(0.001, 0.01, 0.05) tex

svy: reg item_herd age female education i.income interest knowledge leftright conspiracy health_self health_family work_self work_family

outreg2 using myfile, alpha(0.001, 0.01, 0.05) tex


*****OLS regressions with fully factorized political interest

svy: reg item_weapon age female education income i.interest knowledge leftright conspiracy health_self health_family work_self work_family

outreg2 using myfile, alpha(0.001, 0.01, 0.05) tex replace

svy: reg item_liberties age female education income i.interest knowledge leftright conspiracy health_self health_family work_self work_family

outreg2 using myfile, alpha(0.001, 0.01, 0.05) tex

svy: reg item_flu age female education income i.interest knowledge leftright conspiracy health_self health_family work_self work_family

outreg2 using myfile, alpha(0.001, 0.01, 0.05) tex

svy: reg item_herd age female education income i.interest knowledge leftright conspiracy health_self health_family work_self work_family

outreg2 using myfile, alpha(0.001, 0.01, 0.05) tex


*****Ordinal logistic regressions

svy: ologit item_weapon age female education income interest knowledge leftright conspiracy health_self health_family work_self work_family

outreg2 using myfile, alpha(0.001, 0.01, 0.05) tex replace

svy: ologit item_liberties age female education income interest knowledge leftright conspiracy health_self health_family work_self work_family

outreg2 using myfile, alpha(0.001, 0.01, 0.05) tex

svy: ologit item_flu age female education income interest knowledge leftright conspiracy health_self health_family work_self work_family

outreg2 using myfile, alpha(0.001, 0.01, 0.05) tex

svy: ologit item_herd age female education income interest knowledge leftright conspiracy health_self health_family work_self work_family

outreg2 using myfile, alpha(0.001, 0.01, 0.05) tex


*****OLS regressions controlling for EU benefit attitudes

svy: reg item_weapon age female education income interest knowledge leftright conspiracy health_self health_family work_self work_family item_eu

outreg2 using myfile, alpha(0.001, 0.01, 0.05) tex replace

svy: reg item_liberties age female education income interest knowledge leftright conspiracy health_self health_family work_self work_family item_eu

outreg2 using myfile, alpha(0.001, 0.01, 0.05) tex 

svy: reg item_flu age female education income interest knowledge leftright conspiracy health_self health_family work_self work_family item_eu

outreg2 using myfile, alpha(0.001, 0.01, 0.05) tex 

svy: reg item_herd age female education income interest knowledge leftright conspiracy health_self health_family work_self work_family item_eu

outreg2 using myfile, alpha(0.001, 0.01, 0.05) tex 


